package com.yanze.schoolinformation.view.community;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.yanze.schoolinformation.R;
import com.yanze.schoolinformation.base.BaseFragment;
import com.yanze.schoolinformation.databinding.FragmentCommunityBinding;
import com.yanze.schoolinformation.utils.PerfectClickListener;
import com.yanze.schoolinformation.view.community.circle.FriendCircleActivity;
import com.yanze.schoolinformation.view.community.circle.SecondBookActivity;

/**
 * Created by MrZheng on 2018/3/14.
 */

public class CommunityFragment extends BaseFragment<FragmentCommunityBinding> {

    @Override
    public int setContent() {
        return R.layout.fragment_community;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        showContentView();
        initView();
    }

    private void initView() {
        MyOnlcick myOnlcick = new MyOnlcick();
        bindingView.btnFriend.setOnClickListener(myOnlcick);
        bindingView.btnBook.setOnClickListener(myOnlcick);
    }

    private class MyOnlcick extends PerfectClickListener{

        @Override
        protected void onNoDoubleClick(View v) {
            switch (v.getId()) {
                case R.id.btn_friend:
                    FriendCircleActivity.start(getContext());
                    break;
                case R.id.btn_book:
                    SecondBookActivity.start(getContext());
                    break;
            }
        }
    }
}
